﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VipSys.SystemEntity;
using VipSys.DataLayer;

namespace VipSys.Business
{
    public class Roomie
    {
        private static Roomie m_Instance = null;
        /// <summary>
        /// 单实例
        /// </summary>
        public static Roomie Instance
        {
            get
            {
                if (m_Instance == null)
                    m_Instance = new Roomie();
                return m_Instance;
            }
        }
        public User GetRoomie(int ID,string szRoom,string szHotel)
        {
            List<User> lstUser = new List<User>();
            User user=new User();
            user.ID = ID;
            user.Room = szRoom;
            user.Hotel = szHotel;
            UserAccess.Instance.GetUserList(user, ref lstUser,null);
            foreach (var roomie in lstUser)
            {
                if (roomie.ID != ID)
                    return roomie;
            }
            return null;
        }

    }
}
